$(document).ready(function () {
    sszj.onload();
})
var sszj = (function () {
	var init = function () {
    	layui.use('form', function(){
			  var form = layui.form
		});
    }
    return {
        onload : function () {
        	init();
            sszj.tableDataSszj();
        },
       /*表格数据交互*/
      tableDataSszj: function() {
 		var data = [{
 				"number": "1",
 				"name": "黄敬敬",
 				"cardType": "居民身份证",
 				"id":"410923198512232427",
 				"zsType": "税务师",
 				"zsTime":"2016-11-01",
 				"zsNumber":"00006367",
 				"hyNumber":"410002061",
 				"personType":"代表合伙人或股东"
 			},
 			{
 				"number": "2",
 				"name": "黄敬敬",
 				"cardType": "居民身份证",
 				"id":"410923198512232427",
 				"zsType": "税务师",
 				"zsTime":"2016-11-01",
 				"zsNumber":"00006367",
 				"hyNumber":"410002061",
 				"personType":"代表合伙人或股东"
 			},
 			{
 				"number": "3",
 				"name": "黄敬敬",
 				"cardType": "居民身份证",
 				"id":"410923198512232427",
 				"zsType": "税务师",
 				"zsTime":"2016-11-01",
 				"zsNumber":"00006367",
 				"hyNumber":"410002061",
 				"personType":"代表合伙人或股东"
 			},
 			{
 				"number": "4",
 				"name": "黄敬敬",
 				"cardType": "居民身份证",
 				"id":"410923198512232427",
 				"zsType": "税务师",
 				"zsTime":"2016-11-01",
 				"zsNumber":"00006367",
 				"hyNumber":"410002061",
 				"personType":"代表合伙人或股东"
 			}
 		];
 		$('#wepSszj').DataTable({
 			"data": data,
 			"columns": [
 			    {
 					"data": "number"
 				},
 				{
 					"data": "name"
 				},
 				{
 					"data": "cardType"
 				},
 				{
 					"data": "id"
 				},
 				{
 					"data": "zsType"
 				},
 				{
 					"data": "zsTime"
 				},
 				{
 					"data": "zsNumber"
 				},
 				{
 					"data": "hyNumber"
 				},
 				{
 					"data": "personType"
 				}
 			],
// 			"paging": false,
 			"info": false,
 			"ordering": false,
 			"lengthChange": false,
 			"searching": false,
 			"scrollX":true,
 			"fnInitComplete": function (oSettings, json) {/*判断认证状态显示字体颜色*/
	            for(var i=0;i<$('#wepBsjd tbody tr').length;i++){
	            	if($('#wepBsjd tbody tr').eq(i).find('td').eq(4).text() == "已完成"){
	            		$('#wepBsjd tbody tr').eq(i).find('td').eq(4).addClass('font1')
	            	}else if($('#wepBsjd tbody tr').eq(i).find('td').eq(4).text() == "已退回"){
	            		$('#wepBsjd tbody tr').eq(i).find('td').eq(4).addClass('font2')
	            	}else{
	            		$('#wepBsjd tbody tr').eq(i).find('td').eq(4).addClass('font3')
	            	}
	            }
	        }
 		});
     }
    }
})();